package com.go.hibernate.model;

import java.io.Serializable;

@SuppressWarnings("serial")
public class CompositeIdPK implements Serializable {
	private Integer id;
	private String name;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public int hashCode() {
		return this.name.hashCode();
	}

	@Override
	public boolean equals(Object o) {
		if (o instanceof CompositeIdPK) {
			CompositeIdPK pk = (CompositeIdPK) o;
			if (this.id == pk.getId() && this.name == pk.getName())
				return true;
		}
		return false;
	}

}
